home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4912 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  57 lines

  1. Path: news.ov.com!news
  2. From: glenn@ov.com (Fletcher.Glenn@ov.com)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Where Can I Find Standard C Library S
  5. Date: 7 Feb 1996 22:27:33 GMT
  6. Organization: OpenVision
  7. Message-ID: <4fb90l$ouo@spanky.pls.ov.com>
  8. References: <4fb8mf$ouo@spanky.pls.ov.com>
  9. Reply-To: glenn@ov.com
  10. NNTP-Posting-Host: foghorn.pls.ov.com
  11.  
  12. In article ouo@spanky.pls.ov.com, glenn@ov.com (Fletcher.Glenn@ov.com) writes:
  13. >In article jt@mother.usf.edu, yatesc@csee.usf.edu (Randy Yates) writes:
  14. >>I mean the source for functions like printf and strcpy.
  15. >>
  16. >>I've read the FAQ but didn't see anything about this.
  17. >>-- 
  18. >>% Randy Yates                  % "...the answer lies within your soul
  19. >>% EE/Mathematics Student       %       'cause no one knows which side 
  20. >>% University of South Florida  %                   the coin will fall."
  21. >>% <yatesc@csee.usf.edu>        %  'Big Wheels', *Out of the Blue*, ELO   
  22. >>
  23. >
  24. >printf is usually very system specific once you get down to the level
  25. >of actually outputting characters to a display device.  Therefore,
  26. >you can only talk about source for a specific platform.
  27. >
  28. >As for strcpy:
  29. >
  30. >int strcpy(char *destination, char *source)
  31. >{
  32. >     while((*destination++ = *source++) != '\0');
  33. >}
  34. >
  35. >In general, it depends on the purpose of the function as to how
  36. >platform independent the source is.  Usually anything that uses
  37. >system hardware (I/O devices, Floating Point Units, etc) is
  38. >system dependent, and just about everything else is not.
  39. >
  40. >        Fletcher.Glenn@ov.com
  41. >
  42. >
  43.  
  44.  
  45. Whoops! for strcpy:
  46.  
  47. char *strcpy(char *destination, char *source)
  48. {
  49.     char *retval;
  50.  
  51.     retval = destination;
  52.     while((*destination++ = *source++) != '\0');
  53.     return(retval);
  54. }
  55.             Fletcher.Glenn@ov.com
  56.  
  57.